﻿using Grpc.Core;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace EasyShop.UserService.Services
{
    public class GUserService:gUser.gUserBase
    {
        // 和ASP.NETCore一样，可以使用依赖注入和服务
        private readonly ILogger<GUserService> _logger;
        public GUserService(ILogger<GUserService> logger)
        {
            _logger = logger;
        }

        /// <summary>
        /// 重写 设计对应的多个接口
        /// 一般都是异步处理
        /// </summary>
        /// <param name="request"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public override Task<UserReply> Get(UserRequest request, ServerCallContext context)
        {
            return Task.FromResult(new UserReply
            {
                Id = "1",
                UserName = "3"
            });
        }
    }
}
